cmake_minimum_required(VERSION 3.10)

project(qtvplugin_grid VERSION 1.0 LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)

set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)


find_package(QT NAMES Qt6 Qt5 COMPONENTS Widgets REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Widgets REQUIRED)

set(PRJ_HEADERS
	../qtviewer_planetosm/osmtiles/layer_interface.h
	../qtviewer_planetosm/osmtiles/viewer_interface.h
	../geocalc/geocalc.h
	qtvplugin_grid.h
)

set(PRJ_SOURCES
	qtvplugin_grid.cpp
)

set(PRJ_FORMS
	qtvplugin_grid.ui
)

set(PRJ_RESOURCES
	resources.qrc
	qtvplugin_grid_zh_CN.ts
)

add_library(qtvplugin_grid SHARED
	${PRJ_HEADERS}
	${PRJ_SOURCES}
	${PRJ_FORMS}
	${PRJ_RESOURCES}
)


target_compile_definitions(qtvplugin_grid PRIVATE PLANETOSM_EXPORT_DLL)
target_link_libraries(qtvplugin_grid PRIVATE
	Qt${QT_VERSION_MAJOR}::Widgets
)
